<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>转义字符练习</title>
</head>

<body>
    <script>
        // 替换里面的PPTV
        var w = "我在PPTV视频里面看电视剧";
        var ww = /pptv/i;
        var www = w.replace(ww, "ccTV")
        console.log(www);

        // 这一系列表示，字符串里面是否有空格，\s 表示空格的意思
        var a = "我在这里等你 回来";
        var b = /\s/;
        var c = b.test(a);
        console.log(c); // true
        // 去掉所有的空格
        var aa = "asda sadasd dsadas dsadasd";
        var cc = aa.replace(/\s/g, "");
        console.log(cc);//asdasadasddsadasdsadasd
    </script>
</body>

</html>